﻿<%@ Page Title="" Language="C#" MasterPageFile="~/form/MasterPage.Master" AutoEventWireup="true" CodeBehind="Pedido.aspx.cs" Inherits="web.form.Pedido" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="Panel1" runat="server">
        <asp:Panel ID="pnlPedido" runat="server">
        <br/>
        <h1>Nota de pedido</h1>
        <hr/> 
        <br/>
        <h5 class="header2">Productos existentes</h5>
            <asp:Label ID="lblProveedor" runat="server" Text="Proveedor: "></asp:Label>
            <asp:DropDownList ID="cmbProveedores" runat="server" CssClass="combo" 
                              AutoPostBack="True" onselectedindexchanged="cmbProveedores_SelectedIndexChanged"/>
            <br />

            <asp:Label ID="lblCodigoFiltro" runat="server" Text="Codigo: "></asp:Label>
            <asp:TextBox ID="txtCodigoFiltro" runat="server" CssClass="text"></asp:TextBox>

            <asp:Button ID="cmdFiltrar" runat="server" Text="Filtrar" CssClass="boton" 
                onclick="cmdFiltrar_Click"/>

            <asp:Button ID="cmdRefrescarLista" runat="server" 
                Text="Refrescar lista de productos" CssClass="boton" 
                onclick="cmdRefrescarLista_Click" Width="220px"/>

            <br />
            <br />
            <a href="Productos.aspx" target="_blank" class="boton">Ingresar nuevo producto</a>
            <br />

        <br />

            <asp:GridView ID="gvProductos" runat="server" CellPadding="4" 
                        EnablePersistedSelection="True" ForeColor="#333333" 
            GridLines="None" onselectedindexchanged="gvProductos_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#78bbe6" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            <Columns>
                <asp:CommandField SelectText="Pedir" ShowSelectButton="True" />
                <asp:BoundField DataField="Codigo" HeaderText="Codigo" ReadOnly="True" 
                    Visible="False" />
            </Columns>
        </asp:GridView>

            <br />
            <asp:Panel ID="pnlCantidad" runat="server">
            <asp:Label ID="lblCantidad" runat="server" Text="Cantidad: "></asp:Label>
            <asp:TextBox ID="txtCantidad" runat="server"></asp:TextBox>
            <asp:Button ID="cmdAgregar" runat="server" Text="Agregar" CssClass="boton" 
                onclick="cmdAgregar_Click"/>
                <asp:Label ID="lblMensaje" runat="server" ForeColor="Red"></asp:Label>
            </asp:Panel>

            
            <br />

            <asp:Panel ID="pnlProductosPedir" runat="server">
                <h5 class="header2">Productos a pedir</h5>
            <asp:GridView ID="gvProductosAPedir" runat="server" CellPadding="4" 
            EnablePersistedSelection="True" ForeColor="#333333" GridLines="None" 
                AutoGenerateColumns="False"  
                    onselectedindexchanged="gvProductosAPedir_SelectedIndexChanged" 
                    onrowdeleting="gvProductosAPedir_RowDeleting">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField DataField="id" HeaderText="ID" />
                    <asp:BoundField DataField="codigo" HeaderText="Codigo" />
                    <asp:BoundField DataField="cantidad" HeaderText="Cantidad" />
                    <asp:BoundField DataField="tipoProd" HeaderText="Tipo Prod" />
                    <asp:BoundField DataField="descripcion" HeaderText="Descripcion" />
                    <asp:CommandField ShowDeleteButton="True">
                    <ItemStyle BorderColor="Red" />
                    </asp:CommandField>
                </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#78bbe6" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
                <asp:Button ID="cmdPedir" runat="server" Text="Guardar Pedido" CssClass="boton" 
                    onclick="cmdPedir_Click" Width="119px" />
                <br />
            </asp:Panel>
            
            
            <br />

        </asp:Panel>
    </asp:Panel>
</asp:Content>

